package EA.operators.recombination;
import EA.*;

/** Abstract class for crossover on numerical genomes. */
public class NumCrossover
{
  protected static String crossovername;

  /** Produce one offspring from two parents.
      @param parent1 The first parent.
      @param parent2 The second parent.
      @param params The parameters for the operator.
  */
  public static NumericalGenome crossover(NumericalGenome parent1, NumericalGenome parent2, double[] params) 
    {
      if (crossovername==null)
	System.out.println("The variant \"one offspring from two parents\" of the crossover operator is not implemented.");
      else
	System.out.println("The variant \"one offspring from two parents\" of the crossover operator is not implemented in "+crossovername+".");
      System.exit(0);
      return null;
    }

  /** Produce one offspring from N parents.
      @param parents The array of parents.
      @param params The parameters for the operator.
  */
  public static NumericalGenome crossover(NumericalGenome[] parents, double[] params) 
    {
      if (crossovername==null)
	System.out.println("The variant \"one offspring from N parents\" of the crossover operator is not implemented.");
      else
	System.out.println("The variant \"one offspring from N parents\" of the crossover operator is not implemented in "+crossovername+".");
      System.exit(0);

      return null;
    }

    
  /** Produce an array of offspring from two parents.
      @param parent1 The first parent.
      @param parent2 The second parent.
      @param params The parameters for the operator.
  */
  public static NumericalGenome[] crossover2(NumericalGenome parent1, NumericalGenome parent2, double[] params) 
    {
      if (crossovername==null)
	System.out.println("The variant \"array of offspring from two parents\" of the crossover operator is not implemented.");
      else
	System.out.println("The variant \"array of offspring from two parents\" of the crossover operator is not implemented in "+crossovername+".");

      System.exit(0);
      return null;
    }

  /** Produce an array of offspring from N parents.
      @param parents The array of parents.
      @param params The parameters for the operator.
  */
  public static NumericalGenome[] crossover2(NumericalGenome[] parents, double[] params) 
    {
      if (crossovername==null)
	System.out.println("The variant \"array of offspring from two parents\" of the crossover operator is not implemented.");
      else
	System.out.println("The variant \"array of offspring from two parents\" of the crossover operator is not implemented in "+crossovername+".");

      System.exit(0);
      return null;
    }

}
